package com.jan.activemq01.service;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.Session;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.jms.core.MessageCreator;
import org.springframework.stereotype.Service;
@Service
public class QueueSender {
	@Autowired
	private JmsTemplate jmsTemplate;
	public void sendMessage() {
		jmsTemplate.send(new MessageCreator() {
			@Override
			public Message createMessage(Session session) throws JMSException {
				
				return session.createTextMessage("hello word");
			}
		});
	}
}
